<?php if (!defined('BASEPATH')) exit('No direct script access allowed');

class Migration_newsletter_records extends CI_Migration {
	public function up() {
		echo 'Migration 2';
		$this->dbforge->add_field(array(
			'nrid' => array(
				'type' => 'INT',
				'unsigned' => true,
				'auto_increment' => true
			),
			'nid' => array(
				'type' => 'INT',
				'unsigned' => true,
			),
			'sid' => array(
				'type' => 'INT',
				'unsigned' => true,
			),
			'status' => array(
				'type' => 'INT',
				'unsigned' => true
			),
			'send' => array(
				'type' => 'INT',
				'unsigned' => true,
				'null' => TRUE
			)
		));

		$this->dbforge->add_key('nrid', TRUE);
		$this->dbforge->add_key(array('nid', 'sid'));
		$this->dbforge->create_table('ci_newsletter_records');
	}

	public function down() {
		$this->dbforge->drop_table('ci_newsletter_records');
	}
}